package com.tanhua.admin.task;

import io.netty.channel.ChannelHandler;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class AnalysisTask {
        /*定时任务*/
    /*配置时间规则*/
    @Scheduled(cron =  "0/5 * * * * ? ")
    public void analys(){
        String time=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        System.out.println("当前时间："+time);
    }
}
